import React, { Component } from 'react'

export default class App extends Component {
	state = {
		count: 0
	}
	handelClick() {
		//
		console.log(this.state.count)
	}
	render() {
		return (
			<div style={{ textAlign: 'center' }}>
				<h2>计数器:{this.state.count}</h2>
				{/* 外面包一层箭头函数 */}
				<button onClick={this.handelClick.bind(this)}>+1</button>
			</div>
		)
	}
}
